package com.doit.demo01;

public class Test {
    public static void main(String[] args) {
        StringBuilder sb = new StringBuilder();
        sb.append("今晚打脑斧").append(123).append("lets go");
        String string = sb.toString();
        System.out.println(string);

        System.out.println("-------------------------------");

        String s = "abcdefd";
        String ss = new StringBuilder(s).reverse().toString();
        System.out.println(s);
        System.out.println(ss);

        int [] a = {1,34,56,23};
        String aa = to(a);
        System.out.println(aa);
    }

    private static String to(int[] a) {
        StringBuilder s = new StringBuilder();
        s.append("[");
        for(int b:a)
        {
            s.append(b);
            if(b==a[a.length-1])
                s.append("]");
            else
                s.append("-");
        }
        return s.toString();
    }
}
